VoiceText

The VoiceText Channel is dedicated to voice integration in Contact Centers and covers the scenario when the voice service and the voice bot are delivered by third parties. Unlike traditional voice chat channels, this integration ensures quick responses to the user.

The diagram below provides a high-level overview on how to integrate voice in Contact centers using external Voice bots.

 

Third-party Voice bot delivers SIP connection with the Contact Center (asynchronous communication). Sometimes, the Voice Bot role can be delivered by the Contact Center too.

  1. The Voice bot delivers Speech to Text and Text to Speech services.
  2. The Voice bot sends text request to Druid.
  3. Druid responds the Voice Bot text response (synchronous response communication).

How it works

The figure below describes the detailed integration sequence.

  1. When there is an incoming call, the Contact Center initiates the conversation with Druid Virtual Assistant to optimize the response with the Welcome message.
    1. The Contact Center initiates the conversation with the Voice bot.
    2. The Voice bot initiates the conversation with Druid Virtual Assistant, which authenticates the conversation.
    3. Druid Virtual Assistant responds with the Welcome Message.
  2. The Contact Center picks up the call and responds with the welcome message.
    1. Voice bot responds with the Welcome Message.
    2. The Contact Center gives the Welcome message to the user.
  3. The Contact Center captures the “User says”.
    1. The Contact Center sends SIP to the Voice bot.
    2. The Voice bot converts Speech to Text and sends the text user says to Druid Virtual Assistant, calling Druid API CreateActivity (user says).
  4. Druid Virtual Assistant responds.
    1. Druid Virtual Assistant responds synchronously with the bot response (in text format).
    2. The Voice bot checks if the response contains instructions to transfer the call to human agent. If the response does not contain instructions to route the call to human, the Voice bot transforms Text to Speech; otherwise, it performs the next step.
    3. The Voice bot responds to the Contact Center with voice (SIP connection).
    4. The Contact Center responds to the user with voice.
  5. The User closes the call.
    1. The Contact Center announces the VoiceBot that the conversation is closed.
    2. The Voice bot announces Druid Virtual Assistant that the conversation is closed.
  6. Transfers the call to Human Agent.
    1. The Voice bot announces the Contact Center to transfer the call to Human.
    2. The Contact Center executes the transfer.
    3. Helpdesk agent and User are now talking directly.
Hint:  In DRUID version 5.0 and higher, whenever a channel timeout occurs (connection isdropped), the following message is logged in Conversation History "[Channel connection timed out]. The voice channel connection timeout threshold was reached. The previous bot message may have also been dropped before reaching the client's conversation."

Prerequisites

  • For DRUID on premise deployments, make sure that you provide inbound access from the following messaging endpoint: DRUID.BotApp.

Druid VoiceText Channel Integration

The VoiceText channel is active by default in Druid. To integrate your Druid bot with a third-party Voice bot, from Druid Portal, bot settings, go to channels, click VoiceText and copy the values of Authorize URL and Bot URL. Use these values to configure your Voice bot.

The following fields are available in DRUID:

  • [[ChatUser]].ChannelId = "voicetext"
  • [[ChatUser]].UserId - Stores the user's unique identifier.

DRUID API: Authorize

POST: Use the Authorize URL *.druidplatform.com/api/services/app/Chat/AuthorizeAnonymousAsync

Request Body

{
   "botId": "<bot_id>",
   "queryString": "phone=<phone>",
   "channelId": "voicetext"
			}

Response

{
   "botId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "userId": "string",
   "conversationId": "string",
   "token": "string"
}

The returned token has a validity of 1 hour.

DRUID API: Send Messages (Create Activity)

Send User Says

Syntax

POST: Use the Bot URL *.druidplatform.com/api/voicetext/{botId}/messages

Request Header

In the request header, map the Authorize key to the bearer token obtained from the Authorize API. Use the DRUID-specific CONCAT function for the Authorize key value with the following syntax:

Copy

Authorize value mapping

CONCAT('Bearer ',[[Entity]].StringField)

Here, [[Entity]].StringField represents the field that stores the token obtained from the Authorize API.

Request Body

{
    "type": "message",
    "channelId": "voicetext",
    "conversation": {
            "id": "<conversationId>"
    },
    "from": {
            "id": "<userId>"
    },
    "text": "<user says>",
    "timeout": 50
 }

The timeout parameter, available in DRUID 8.13 and higher, enables you to specify a duration in seconds for the system to wait for a response from the Flow Engine. If the Flow Engine doesn't respond within the configured timeout period, the system will log an error in the Conversation History.

Send Conversation Closed

{
    "type": "message",
    "channelId": "voicetext",
    "conversation": {
            "id": "<conversationId>"
    },
    "from": {
            "id": "<userId>"
    },
    "text": "close_conversation",
    "timeout": 50
}

In Druid Portal, create a flow with the single training phrase “close_conversation”. This flow will be triggered by the call above.

Responds with Message

{
    "type": "message",
    "channelId": "voicetext",
    "conversation": {
            "id": "<conversationId>"
    },
    "to": {
            "id": "<userId>"
    },
    "text": "<bot response>",
    "speak": "<bot response>"
}
Note:  You should take the content from “speak”. In Druid Portal, you can fine-tune the text response for voice channel in the Voice section on your specific flow step(s). You can include SSML markups as recognized by your TTS service. By default, Druid uses Microsoft schema.

Responds with Event (transfer to human)

{
     "type": "event",
     "channelId": "voicetext",
     "conversation": {
            "id": "<conversationId>"
     },
     "to": {
           "id": "<userId>"
     },
     "name": "route-to-human",
     "value": "input_mapping_json_object"
 }
Note:  To transfer calls to humans, in Druid Portal add a step of type Backchannel and name the step with your preferred keyword (e.g. “route-to-human”). In Input mapping on this step, set the Druid entity storing additional information (e.g., subject, queue name, etc.); provide the entity you agreed with the Contact Center. The response sent by Druid to the Voice bot in JSON format will have in the “value” attribute the Druid entity provided in Input mapping.